using System;
using System.Collections.Generic;
using System.Drawing;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GURUCORE.Portal.AspNet.Control
{
    /// <summary>
    ///                                                                         
    /// <PARAM NAME="_cx" VALUE="21590">
    /// <PARAM NAME="_cy" VALUE="2117">
    /// 	<PARAM NAME="FlashVars" VALUE="">
    /// 	<PARAM NAME="Movie" VALUE="noel2.swf">
    /// 	<PARAM NAME="Src" VALUE="noel2.swf">
    /// 	<PARAM NAME="WMode" VALUE="Window">
    /// 	<PARAM NAME="Play" VALUE="-1">
    /// 	<PARAM NAME="Loop" VALUE="-1">
    /// 	<PARAM NAME="Quality" VALUE="High">
    /// 	<PARAM NAME="SAlign" VALUE="">
    /// 	<PARAM NAME="Menu" VALUE="-1">
    /// 	<PARAM NAME="Base" VALUE="">
    /// 	<PARAM NAME="AllowScriptAccess" VALUE="">
    /// 	<PARAM NAME="Scale" VALUE="ShowAll">
    /// 	<PARAM NAME="DeviceFont" VALUE="0">
    /// 	<PARAM NAME="EmbedMovie" VALUE="0">
    /// 	<PARAM NAME="BGColor" VALUE="">
    /// 	<PARAM NAME="SWRemote" VALUE="">
    /// 	<PARAM NAME="MovieData" VALUE="">
    /// 	<PARAM NAME="SeamlessTabbing" VALUE="1">
    /// 	<PARAM NAME="Profile" VALUE="0">
    /// 	<PARAM NAME="ProfileAddress" VALUE="">
    /// 	<PARAM NAME="ProfilePort" VALUE="0">
    /// 	<PARAM NAME="AllowNetworking" VALUE="all">
    /// 	<PARAM NAME="AllowFullScreen" VALUE="false">
    /// 
    /// </summary>
    /// 
    [ToolboxBitmap(typeof(TextBoxS), "resGURUCORE.ico")]
    [Description("Flash Displayer")]
    public class Flasher : Literal
    {
        private string sSWFFile;
        private string nSWFWidth;
        private string nSWFHeight;

        private System.Collections.Specialized.NameValueCollection arrParam = new System.Collections.Specialized.NameValueCollection();

        [Bindable(false),
        Category("Appearance")]
        public string SWFFile
        {
            get
            {
                return sSWFFile;
            }
            set
            {
                sSWFFile = value;
            }
        }


        [Bindable(false),
        Category("Appearance")]
        public string SWFWidth
        {
            get
            {
                return nSWFWidth;
            }
            set
            {
                nSWFWidth = value;
            }
        }

        [Bindable(false),
        Category("Appearance")]
        public string SWFHeight
        {
            get
            {
                return nSWFHeight;
            }
            set
            {
                nSWFHeight = value;
            }
        }


        [Bindable(false),
        Category("SWF")]
        public System.Collections.Specialized.NameValueCollection ParamArray
        {
            get
            {
                return arrParam;
            }
            set
            {
                arrParam = value;
            }
        }



        protected override void Render(HtmlTextWriter writer)
        {
            base.Text = ""
 + "			<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "
 + "	 codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" "
 + "		 width=\"" + nSWFWidth + "\" "
 + "			 height=\"" + nSWFHeight + "\">"
 + "<param name=movie value=\"" + sSWFFile + "\">"
 + "<param name=quality value=high>";


            foreach (string sKey in arrParam.AllKeys)
            {
                base.Text += "<param name=" + sKey + " value=" + arrParam[sKey] + ">";
            }

            base.Text += ""
             + "<embed src=\"" + sSWFFile + "\" "
             + "	 quality=high "
             + "	 pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" "
             + "		 type=\"application/x-shockwave-flash\" "
             + "			 width=\"" + nSWFWidth + "\" "
             + "				 height=\"" + nSWFHeight + "\">"
             + "</embed>"
             + "</object>"
             + ""
                              ;

            base.Render(writer);
        }
    }
}
